import React, { Component } from 'react';
import './App.less';
import { deal } from '../store/'
import Login from '../page/login/Login'
import Page from '../page/Page/Page'
import { userInfo } from '../actions';
 
class App extends Component {
	componentDidMount() {
		this.props.dispatch(userInfo())
	}

	render() {
		let { dispatch, state } = this.props;
		// console.log(state);
		if(state.username) {
			return(<Page dispatch={dispatch}></Page>)
		}else {
			return (<DealLogin dispatch={dispatch}></DealLogin>)
		} 
				
	}
}
let DealLogin = deal(Login)
export default App;
